package com.gzz.orchid.context.application.base.convert;

import com.gzz.orchid.context.application.base.command.AddressSaveCmd;
import com.gzz.orchid.context.application.base.pojo.AddressDto;
import com.gzz.orchid.context.application.base.pojo.AddressVo;
import com.gzz.orchid.context.infrastructure.persistence.entity.base.BaseAddressPo;
import org.mapstruct.Mapper;
import org.mapstruct.MappingTarget;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

/**
 * @author higmd
 */
@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface AddressConverter {
    AddressConverter INSTANCE = Mappers.getMapper(AddressConverter.class);


    AddressVo mapVo(BaseAddressPo po);


    AddressDto mapDto(BaseAddressPo po);

    void updatePo(@MappingTarget BaseAddressPo po, AddressSaveCmd cmd);
}
